//Copyright (C) 2009 Ron Coleman. Contact: ronncoleman@gmail.com
//
//This library is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 3 of the License, or (at your option) any later version.
//
//This library is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this library; if not, write to the Free Software
//Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

package org.workplicity.cia.table.render;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 * Customer renderer for elog table.
 * @author Ron Coleman
 */
public class BaseTableRenderer extends DefaultTableCellRenderer {
    public static final Color bgHotColor = new Color(255,184,129); //new Color(255,128,64);
    public static final Color bgFreshColor = new Color(128,255,128);
    
    public static final Color fgChangeColor = Color.black;

    public static final Color bgSelectedColor = new Color(160,255,255); //Color.cyan;
    public static final Color fgSelectedColor = new Color(255,255,255);

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

        if(isSelected)
            setBackground(bgSelectedColor);
        else
            setBackground(Color.white);
            
        setForeground(Color.black);
        
        return this;
    }
}
